/*
 * BlackLightning.PluginLib.Modules.Message
 * Andy Tidball
 * 
 * Project: Black Lightning Plugin Library
 * Copyright: GNU General Public License
 */

using System;
using BlackLightning.PluginLib.LoginClients;
using BLLib.Configuration;

namespace BlackLightning.PluginLib {
	/// <summary>
	/// Represents a private message sent between a module and Black Lightning.
	/// </summary>
	[Serializable]
	public class Message {
	}

	/// <summary>
	/// Sent by Black Lightning to inform an object that it has just been loaded.
	/// </summary>
	[Serializable]
	public class LoadedMessage : Message {
		// member data
		private Game?     _Game;      // the game being played
		private FrontEnd? _FrontEnd;  // the front end being used
		private string    _Character; // the character being played
		private string    _Folder;    // the folder where the plugin should store data files

		/// <summary>
		/// Creates a new LoadedMessage.
		/// </summary>
		/// <param name="DataFolder">The full path of the folder where data files should be stored.</param>
		public LoadedMessage(string DataFolder) {
			_Game      = null;
			_FrontEnd  = null;
			_Character = null;
			_Folder    = DataFolder;
		}

		/// <summary>
		/// Creates a new LoadedMessage.
		/// </summary>
		/// <param name="SAL">The SAL file used to login to the game.</param>
		public LoadedMessage(SalFile SAL) {
			_Game      = SAL.Game;
			_FrontEnd  = SAL.FrontEnd;
			_Character = SAL.Character;
			_Folder    = null;
		}

		/// <summary>
		/// Creates a new LoadedMessage.
		/// </summary>
		/// <param name="SAL">The SAL file used to login to the game.</param>
		/// <param name="DataFolder">The full path of the folder where data files should be stored.</param>
		public LoadedMessage(SalFile SAL, string DataFolder) {
			_Game      = SAL.Game;
			_FrontEnd  = SAL.FrontEnd;
			_Character = SAL.Character;
			_Folder    = DataFolder;
		}

		/// <summary>
		/// Gets or sets the game that the user is playing.
		/// </summary>
		public Game? Game {
			get {
				return _Game;
			}
			set {
				_Game = value;
			}
		}

		/// <summary>
		/// Gets or sets the front end that the user is using.
		/// </summary>
		public FrontEnd? FrontEnd {
			get {
				return _FrontEnd;
			}
			set {
				_FrontEnd = value;
			}
		}

		/// <summary>
		/// Gets or sets the name of the character the user is playing.
		/// </summary>
		public string Character {
			get {
				return _Character;
			}
			set {
				_Character = value;
			}
		}

		/// <summary>
		/// Gets or sets the full path of the folder where data files should be stored.
		/// </summary>
		public string DataFolder {
			get {
				return _Folder;
			}
			set {
				_Folder = value;
			}
		}
	}

	/// <summary>
	/// Sent by Black Lightning to inform an object that it is about to be unloaded.
	/// </summary>
	[Serializable]
	public class UnloadedMessage : Message {
	}

}
